# Maintainer: Daniel M. Capella <polyzen@archlinux.org>

pkgname=firefox-tridactyl
pkgver=1.23.0
_commit=c663b8e23a5f3125ad0a28672f993497756f9f7c
pkgrel=1
pkgdesc="Replace Firefox's control mechanism with one modelled on Vim"
url=https://github.com/tridactyl/tridactyl
arch=('any')
license=('Apache')
groups=('firefox-addons')
makedepends=('git' 'node-gyp' 'python' 'strip-nondeterminism' 'yarn')
source=("git+$url.git#commit=$_commit?signed")
b2sums=('SKIP')
validpgpkeys=('15D03C86837936A0A638AA2D2BB8C36BB504BFF3') # Oliver Blanthorn <freedom4cows@gmail.com>

prepare() {
  cd tridactyl
  yarn install --frozen-lockfile --non-interactive
}

build() {
  cd tridactyl
  scripts/sign nosignstable
  strip-nondeterminism -t zip web-ext-artifacts/tridactyl-$pkgver.xpi
}

package() {
  cd tridactyl
  install -Dm644 web-ext-artifacts/tridactyl-$pkgver.xpi \
    "$pkgdir"/usr/lib/firefox/browser/extensions/tridactyl.vim@cmcaine.co.uk.xpi
}
